package cn.stylefeng.guns.modular.hx.storage.service;

import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
import cn.stylefeng.guns.modular.hx.storage.entity.HxStorageOffShelf;
import cn.stylefeng.guns.modular.hx.storage.model.params.HxStorageOffShelfParam;
import cn.stylefeng.guns.modular.hx.storage.model.result.HxStorageOffShelfResult;
import cn.stylefeng.guns.modular.hx.storage.model.result.HxStoragePutDetailedResult;
import cn.stylefeng.guns.sys.modular.system.entity.User;

import com.baomidou.mybatisplus.extension.service.IService;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 下架任务表 服务类
 * </p>
 *
 * @author 
 * @since 2023-09-13
 */
public interface HxStorageOffShelfService extends IService<HxStorageOffShelf> {

    /**
     * 新增
     *
     * @author 
     * @Date 2023-09-13
     */
    String addItem(HxStorageOffShelfParam param,Long id);

    /**
     * 删除
     *
     * @author 
     * @Date 2023-09-13
     */
    void delete(HxStorageOffShelfParam param);

    /**
     * 更新
     *
     * @author 
     * @Date 2023-09-13
     */
    void update(HxStorageOffShelfParam param);

    /**
     * 查询单条数据，Specification模式
     *
     * @author 
     * @Date 2023-09-13
     */
    HxStorageOffShelfResult findBySpec(HxStorageOffShelfParam param);

    /**
     * 查询列表，Specification模式
     *
     * @author 
     * @Date 2023-09-13
     */
    List<HxStorageOffShelfResult> findListBySpec(HxStorageOffShelfParam param);

    /**
     * 查询分页数据，Specification模式
     *
     * @author 
     * @Date 2023-09-13
     */
     LayuiPageInfo findPageBySpec(HxStorageOffShelfParam param,String condition);


    LayuiPageInfo findOffShelfListPage(HxStorageOffShelf hxStorageOffShelf, String condition);
    List<HxStorageOffShelfResult> findOffShelfList(HxStorageOffShelf hxStorageOffShelf, String condition);

    void add(HxStorageOffShelfParam hxStorageOffShelfParam);

    String offShelf(Long param,User user, BigDecimal xjNum);

    LayuiPageInfo off(HxStorageOffShelfParam hxStorageOffShelfParam, String condition);
    List<HxStorageOffShelfResult> findxiajia(HxStorageOffShelfResult hxStorageOffShelfResult);

	HxStorageOffShelfResult sumOffShelf(HxStorageOffShelfParam hxStorageOffShelfParam);

	List<HxStorageOffShelfResult> findlistAllBySpec(HxStorageOffShelfParam hxStorageOffShelfParam, String condition);

	HxStorageOffShelfResult count(HxStorageOffShelfParam hxStorageOffShelfParam, String condition);

    int updateTaskFlag(HxStorageOffShelfParam hxStorageOffShelfParam);

    /**
     * 超过2/1保质期的自动生成强制下架任务
     * @param warehouseId
     */
    void offShelfTaskJob(Long warehouseId);

    /**
     * 低于安全库存值的需要生产下架任务，当前库存不够拣时，标记加急
     * @param warehouseId
     */
    String safetyStockGenOffShelfTaskJob(Long warehouseId);
}
